package com.example.demo.db;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * Created With IntelliJ IDEA
 * User: Luweiwei
 * Date: 2017/12/19 6452
 * Time: 13:32
 * ProjectName: postgresqldemo
 * 动态数据源
 */
public class DynamicDataSource extends AbstractRoutingDataSource {
    @Override
    protected Object determineCurrentLookupKey() {
        return DynamicDataSourceContextHolder.getDataSourceType();
    }
}
